#ifndef __REQUEST_H__
#define __REQUEST_H__

#include "net.h"
#include "constant.h"
#include <mysql.h>

struct request
{
	int fd;
	int transflag;  //  1 yes ; 0 no
	int erroraccur;  // 1 yes;  0 no
	MYSQL *mysql;
	char *content;   // no need free , point to recv_buff
	char *recv_buff;
	char method[LEN16];
	char url[LEN256];
	struct sockaddr_in addr;
};

int recv_from_req(struct request *request) ;
void free_request(struct request *req);
int parse_method(struct request *req);
int parse_url(struct request *req);
int parse_content(struct request *req);

#endif //__REQUEST_H__